package com.wanxi.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ResultDTO {
    private Integer code;// 编码：1成功，0错误
    private String msg;//自定义字符
    private Integer count;//影响的条数
    private Object data;

    public static ResultDTO getDTO(int count, Object data) {
        ResultDTO resultDTO = ResultDTO.builder()
                .data(data)
                .count(count)
                .code(0)
                .build();
        return resultDTO;
    }
}
